<html>
<head><meta charset="utf-8"><title>rate of new const feature suggestions · t-compiler/const-eval · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/index.html">t-compiler/const-eval</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html">rate of new const feature suggestions</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="197578723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197578723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197578723">(May 14 2020 at 16:11)</a>:</h4>
<p>I am feeling the itch for a new RFC again, this time for const heap or const pointer comparisons... But my previous (arguably large) const RFC is only in provisional status and most of my RFCs from last year aren't even on a stabilization path yet. With this zulip thread I'm hoping to get some opinions from affected parties (<span class="user-group-mention" data-user-group-id="1977">@T-lang</span> <span class="user-group-mention" data-user-group-id="1916">@WG-const-eval</span> ). Do you feel like we have too much stuff going on around const eval right now? Basically just ask yourself the question whether this ping did or a hypothetical ping on the RFC repo would give you any feeling of annoyedness or exhaustion. If you don't want to write here, feel free to just drop me a private message. Please don't let this put any additional pressure on you, a "no more const" totally suffices.</p>



<a name="197578916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197578916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197578916">(May 14 2020 at 16:12)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> I've been wanting to sync up with you on that</p>



<a name="197578972"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197578972" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197578972">(May 14 2020 at 16:13)</a>:</h4>
<p>I don't feel "too much" but I'd like to discuss how to make a better interaction with lang team</p>



<a name="197579019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197579019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197579019">(May 14 2020 at 16:13)</a>:</h4>
<p>I have to review your skill tree, actually, I'm very excited about that</p>



<a name="197579038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197579038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197579038">(May 14 2020 at 16:13)</a>:</h4>
<p>it's not finished yet <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="197579517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197579517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197579517">(May 14 2020 at 16:16)</a>:</h4>
<p>I think there is definitely a need (at least for me <em>personally</em>) to kind of "back up" and set the broader frame, but I think that partly this conversation involves const generics (I know const eval / const gen are separable, it just seems to me like the two are also at least somewhat intertwined)</p>



<a name="197579555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197579555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197579555">(May 14 2020 at 16:16)</a>:</h4>
<p>the skill tree is definitely one way to communicate that tho</p>



<a name="197579602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197579602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197579602">(May 14 2020 at 16:17)</a>:</h4>
<p>I think I would feel a lot happier if we had more consensus around the "end vision"</p>



<a name="197579617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197579617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197579617">(May 14 2020 at 16:17)</a>:</h4>
<p>(even if that end vision evolves)</p>



<a name="197579714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197579714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197579714">(May 14 2020 at 16:17)</a>:</h4>
<p>I think my ideal would be that we have some shared idea of the end vision, along with some of the uncertainties and concerns to be careful of, and delegate the details to you to push along, syncing up every once in a while</p>



<a name="197579790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197579790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197579790">(May 14 2020 at 16:18)</a>:</h4>
<p>"you" here being not necessarily you <em>personally</em> but a project group</p>



<a name="197580151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197580151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197580151">(May 14 2020 at 16:20)</a>:</h4>
<p>yea, a comprehensible plan is probably much better than the tangle of issues we have now</p>



<a name="197582463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197582463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197582463">(May 14 2020 at 16:37)</a>:</h4>
<p>I also would find it useful to get a sense what people outside <code>const-eval</code> think are the most needed features. I also think it's worth investigating possible use-cases internally, since we have a better idea of what various features would enable. For example, the fact that you can do string concatenation at compile-time with <em>only</em> <code>#![feature(const_if_match)]</code> was a surprise to me. Thanks <span class="user-mention" data-user-id="124288">@oli</span>!</p>



<a name="197583354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197583354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197583354">(May 14 2020 at 16:43)</a>:</h4>
<p>One thing that's clear to me is that, without heap allocation in constants, people will resort to fixed-capacity, stack-allocated dynamic arrays like the one in <a href="https://docs.rs/staticvec/0.9.2/staticvec/struct.StaticVec.html">https://docs.rs/staticvec/0.9.2/staticvec/struct.StaticVec.html</a>. I wonder what it would take to make a usable subset of the API for such a data structure stably <code>const</code>? I think we would have to resolve some "unconst" questions at the very least.</p>



<a name="197583675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197583675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197583675">(May 14 2020 at 16:45)</a>:</h4>
<p>const trait methods (for <code>Index</code>) and mutable references (for <code>IndexMut</code>) would also be pretty essential.</p>



<a name="197593543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197593543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> boats <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197593543">(May 14 2020 at 17:57)</a>:</h4>
<p>I think the lack of progress has to do with the lack of capacity the lang team has <em>in general</em> and not something specific to const stuff our your work in particular. And we need to implement a process here that can better handle the lang teams lower capacity, and prioritize this work over other work if necessary.</p>



<a name="197593748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197593748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> boats <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197593748">(May 14 2020 at 17:58)</a>:</h4>
<p>I think I agree with Niko that working out a consensus together on the end vision is probably the next step, at least for the RFC that's pending</p>



<a name="197593860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197593860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197593860">(May 14 2020 at 17:59)</a>:</h4>
<p>I do feel like there's too much const stuff "in flight"... in particular the huge calling-trait-methods RFC, which has yet unresolved interaction questions (at least on the syntactic level) with fn ptrs and trait objects IIRC. my personal feeling is that it's worth "finishing" basic CTFE (covering all language primitives, in particular loops, mutable references and trait calls) before moving to more advanced stuff like heap allocations.</p>



<a name="197619035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197619035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197619035">(May 14 2020 at 21:13)</a>:</h4>
<p>As an outside user: I'd personally be a lot happier to see the "const fn with/in traits" RFC resolved than to see another RFC opened. Traits are a huge part of Rust, to the point where heap and pointer comparisons _almost don't matter_ if you can't also use traits.</p>



<a name="197721935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197721935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197721935">(May 15 2020 at 17:03)</a>:</h4>
<p>As another outside user: I'd personally love to see some case analysis: e.g. From library user side: What are some typical potential usage of const eval? From library author side: Is some existing crates like <a href="https://docs.rs/phf">https://docs.rs/phf</a> able to migrate to const-eval-based eventually? What's blocking the migration at this time? And things like these.</p>



<a name="197882712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197882712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Connor Horman <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197882712">(May 18 2020 at 02:24)</a>:</h4>
<p>As yet another outside user: imo rust const is very limiting compared to, say constexpr in C++. The main thing is that Rust has rules about what const can do, whereas with C++, there are rules about what constexpr cannot do (see the cppreference page on core constant expressions for an exhaustive list)</p>



<a name="197888307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197888307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197888307">(May 18 2020 at 04:33)</a>:</h4>
<p>But isn't that basically the same?</p>



<a name="197888377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197888377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197888377">(May 18 2020 at 04:35)</a>:</h4>
<p>I mean, in the end, the list of "allowed things" should he exhaustive. The main reason you don't see that one or another thing in const yet is because the feature is being grown organically; it comes piece by piece. It's a growing experiment.</p>



<a name="197953213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197953213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Connor Horman <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197953213">(May 18 2020 at 15:42)</a>:</h4>
<p>Its more limiting, imo. There is so much constexpr can do because it doesn't evaluate any of the things a core constant expression isn't allowed to.<br>
It also makes it easier to define certain things. For example, a core constant expression cannot evaluate an expression that has any form of core language undefined behavior. A definition like that would make defining, say transmute, easier, as you don't need to deal with the edge cases. If an invalid value would be produced, it simply isn't a constant expression.</p>



<a name="197960824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/197960824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#197960824">(May 18 2020 at 16:33)</a>:</h4>
<p>the main difference between const in Rust and in C++ is similar to non-const: in Rust, we want to ensure that when you only write safe code, you cannot cause UB. that's what makes our job much harder than C++ constexpr.</p>



<a name="198178738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/rate%20of%20new%20const%20feature%20suggestions/near/198178738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chris Denton <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/rate.20of.20new.20const.20feature.20suggestions.html#198178738">(May 20 2020 at 10:25)</a>:</h4>
<p>From my user-of-stable POV, stabilizing some control flow would be a very big deal for const fn, even if it only worked on primitives. Adding in loop would be the icing on the cake. These would make const fn vastly more useful and get rid of hacky macros/proc-macros that I currently use. Having traits et al would be very nice but (to me personally) are more of a luxury than a necessity.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>